<?php
namespace app\demo\controller;
use think\facade\View;

class User
{
    public function index()
    {
        //调用模型层 实例化 调用方法
        $user = new \app\demo\model\user();
        $list = $user->getUser();

        echo "<pre>";
        print_r($list->toArray());
        echo "<pre>";
    }

    public function getUser()
    {
        $where['keywords'] = '唐僧';
        $info=\app\demo\model\User::getOne(1,$where);

        View::assign('info',$info);
        return view();
    }
}